package org.jetnuke.dao;

import java.util.Date;
import java.util.List;

import org.jetnuke.entities.Stories;

public interface StoriesDAO {
	public Stories retrieveByPK(int storyId) throws Exception ;
	public void incCounter(int storyId)throws Exception;

	public void update(Stories st) throws Exception;

	public void incComments(int id) throws Exception;
	public List getStoriesByTopid_SidDesc(int topic,int limit) throws Exception;

	public int addNew(Stories story)throws Exception ;
	public int countAll()throws Exception;
	public int countByCatID(int catid)throws Exception;
	/**
	 * @param topic
	 * @return
	 */
	public Stories getTopByTopic(int topic)throws Exception;
	/**
	 * @param time
	 * @return
	 */
	public List getStoriesGreaterTime(Date time)throws Exception;
	/**
	 * @param i
	 * @return
	 */
	public List selectOrderBySidDescLimit(int i)throws Exception;
	/**
	 * @return
	 */
	public List getStoriesTimeDesc()throws Exception;
	/**
	 * @param topicid
	 * @return
	 */
	public List getByTopic(int topicid)throws Exception;
	public List getByInformant(String uname)throws Exception;
	/**
	 * @param author
	 * @param category
	 * @param topicid
	 * @param query
	 * @return
	 */
	public List searchOrderTimeDesc(String author, int category, int topicid, String query)throws Exception;
	/**
	 * @param author
	 * @param category
	 * @param query
	 * @return
	 */
	public List searchOrderTimeDesc2(String author, int category, String query)throws Exception;
	/**
	 * @param author
	 * @param topicid
	 * @param query
	 * @return
	 */
	public List searchOrderTimeDesc3(String author, int topicid, String query)throws Exception;

	public List searchOrderTimeDesc4(String author, String query)throws Exception;

	public List searchOrderTimeDesc5(int category, int topicid, String query)throws Exception;

	public List searchOrderTimeDesc6(int category, String query)throws Exception;

	public List searchOrderTimeDesc7(int topicid, String query)throws Exception;

	public List searchOrderTimeDesc8(String query)throws Exception;

	public List selectOrderByCounterDescLimit(int limit)throws Exception;
	
	public List selectVotedOrderScoreDesc(int limit)throws Exception;
	
	public List selectCommentedOrderCommentDesc(int limit)throws Exception;
	
	public List getStoriesInTime(Date time, Date time2)throws Exception;
	
	public void deleteByID(int id)throws Exception;
	
	public void deleteByCatID(int catid)throws Exception;
	
	public void moveCat(int old_cat, int new_cat)throws Exception;
	
	public List getStoriesByCategory_SidDesc(int catid, int limit)throws Exception;
	
}
